package main;


import java.util.ArrayList;

import javax.media.opengl.GL;
import javax.media.opengl.GL2;
import javax.media.opengl.glu.GLU;

import obiecte.SolarSystem;
import obiecte.SpaceObject;

import com.jogamp.opengl.util.gl2.GLUT;


/**
 * Display a simple scene to demonstrate OpenGL.
 * 
 * @author Robert C. Duvall
 */
public class Display extends Scene
{
    // animation state
    // private float myAngle = 0.0f;
    public SolarSystem ss = new SolarSystem();

    /**
     * Create the scene with the given arguments.
     * 
     * For example, the number of teapots to display.
     * 
     * @param args command-line arguments
     */
    public Display (String[] args)
    {
        // do nothing
    }


    /**
     * @return title for this scene
     */
    public String getTitle ()
    {
        return "Solar System";
    }


    /**
     * Draw all of the objects to display.
     */
    public void display (GL2 gl, GLU glu, GLUT glut, ArrayList<TextureHandler> tex)
    {
        ss.draw(gl, glu, glut, tex);
    }


    /**
     * Set the camera's view of the scene.
     */
    public void setCamera (GL2 gl, GLU glu, GLUT glut)
    {
        glu.gluLookAt(
                -12,  10,  30,            // from position
                    0,  0,  0,            // to position
                    0,  1,  0);           // up direction
    }


    /**
     * Animate the scene by changing its state slightly.
     * 
     * For example, the angle of rotation of the shapes.
     */
    public void animate (GL2 gl, GLU glu, GLUT glut)
    {
        ss.animate(gl, glu, glut);
        // animate model by spinning it a few degrees each time
//        myAngle += 4;
    }
    
    public SpaceObject object(String obj){
    	return ss.get(obj);
    }
}